

// function ajax (fn) {
//   setTimeout (() => {
//     console.log('你好')
//   },1000)
// }
// ajax()
// console.log('执行结束')
function delay(word) {
  return new Promise((reslove, reject) => {
    setTimeout(() => {
      reslove(word)
    }, 2000)
  })
}

async function start () {
  const word1 = await delay('xiaoqiang')
  console.log(word1)
  const word2 = await delay('janus')
  console.log(word2)
}
start()

// delay('xiaoqiang')
//   .then((word) => {
//     console.log(word)
//     return delay('janus')
//   })
//   .then((word) => {
//     console.log(word)
//   })
